package core.basic;

public class Piece {
	private int left;
	private int right;

	public int getLeft() {
		return left;
	}

	public int getRight() {
		return right;
	}
	
	public Piece(int left, int right){
		this.left = left;
		this.right = right;
	}
	
	public void invert(){
		int aux = this.left;
		this.left = this.right;
		this.right = aux;
	}

	public boolean equals(Object o) {
		if (o instanceof Piece ){
			Piece p = (Piece) o;
			return ((p.right == this.right && p.left == this.left) ||
					(p.left == this.right && p.right == this.left));
		}
		return false;
	}
	
	public String toString(){
		return "["+left+"|"+right+"]";
	}

	public int getPoints() {
		return getLeft()+getRight();
	}
}
